import gradio as gr
from inference import main

def predict(input):
    output=main(input)
    return output

demo=gr.Interface(fn=predict,
                  inputs="text",
                  outputs="text",
                  examples=["查询所有销售订单的订单编号、订单金额、支付方式","查询所有信用等级为A的客户所下的销售订单的订单编号","查询所有销售订单中有哪些不同的客户"],
                  title="NL2BQL Generator",
                  description="Generate BQL from natural language")

demo.launch()